package com.liu.util;

import com.liu.dao.*;
import com.liu.dao.impl.*;

/**
 * @Author 老刘Matthew
 * @Timestamp 2022/7/21 19:30
 * @Description Singleton DaoFactory in Lazy Mode
 */
public class DaoFactory_ {

    // 懒汉单例
    private static IUserDao userDaoLazy = null;

    public static IUserDao getUserDaoLazy() {

        userDaoLazy = new UserDaoImpl();
        return userDaoLazy;
    }

    // 饿汉单例
    public static IUserDao getUserDao() {

        return new UserDaoImpl();
    }

}

